<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| This file is where you may define all of the routes that are handled
| by your application. Just tell Laravel the URIs it should respond
| to using a Closure or controller method. Build something great!
|
*/

// Route::get('/', function () {
//     return redirect('/home');
//     return view('welcome');
// });

Route::group(['middleware' => ['wechat.oauth'],'namespace' => 'Auth'], function () {
    Route::get('/wxlogin','LoginController@wxLogin');
});

Auth::routes();
Route::get('/', 'HomeController@index');
Route::get('/home', 'HomeController@index');

Route::group(['middleware' => ['auth'],'namespace' => 'Home'], function () {
//Route::group(['middleware' => ['web','auth','wechat.oauth'],'namespace' => 'Home'], function () {
    Route::get('/financialdetails','MemberController@financialDetails');
    Route::get('/userinfo','MemberController@userinfo');
    Route::get('/password','MemberController@password');
    Route::post('/passwordupdate', 'MemberController@passwordUpdate');
    Route::get('/businesscard','MemberController@businessCard');
    Route::post('/uploadbusinesscard','MemberController@uploadBusinessCard');
   
    
    Route::post('/order/insert','OrderController@insert');
    Route::get('/order/position/{option_id}','OrderController@position');
    Route::post('/order/settlement/{option_id}','OrderController@settlement');
    Route::post('/order/unwindorder','OrderController@unwind');
    Route::post('/order/unwindorderall','OrderController@unwindall');

    Route::get('/recharge','MemberController@recharge');
    Route::get('/weixinpay','MemberController@weiXinPay')->middleware('wechat.oauth');
    Route::get('/smpay','MemberController@saoMaPay');
    Route::get('/gzzh','MemberController@gzzh');
    Route::get('/xysmpay','MemberController@xysmPay');
    Route::get('/ylpay','MemberController@yinLianPay');

    Route::get('/option/{symbol}','OptionController@index');
    Route::get('/rules/{symbol}','OptionController@rules');
    Route::get('/news','ArticleController@index');
    Route::get('/news/detail/{id}','ArticleController@detail');

    Route::get('/chat','ChatController@index');
    Route::get('/chat/more','ChatController@more');
    Route::post('/sendchat','ChatController@sendChat');


    Route::get('/commission','CommissionController@index');
    Route::get('/commission/subordinates','CommissionController@subordinates');
    Route::get('/commission/details','CommissionController@details');

    Route::get('/withdrawals','WithdrawalsController@index');
    Route::post('/withdrawals','WithdrawalsController@withdrawals');
    Route::get('/withdrawals/currentbanck/{id}','WithdrawalsController@currentBank');
    Route::get('/withdrawals/banklist','WithdrawalsController@banklist');
    Route::get('/withdrawals/cashing','WithdrawalsController@cashing');
    Route::post('/withdrawals/cashing/storebank','WithdrawalsController@storeBank');
    Route::post('/withdrawals/cashing/deletebank','WithdrawalsController@deleteBank');

    //股票活动
     Route::get('/addstockactivity','ActivityController@addActivity');
     Route::post('/storestockactivity','ActivityController@storeActivity');


    Route::any('money/{id}','WinningController@count_money');
    Route::any('activity/{id}','WinningController@find_activity');
    Route::any('allactivity','ActivityController@index');
    Route::any('winning/{id}','WinningController@find_winning');
    Route::any('create_order','ActivityController@create_order');
    Route::any('show_activity/{id}','ActivityController@show_activity');
    Route::any('sure_pay/{id}','ActivityController@sure_pay');
    Route::any('pay','ActivityController@pay');
    Route::any('sort/{id}','ActivityController@sort');

    Route::get('/stockorder','StockOrderController@index');
    Route::get('/rewardorder','StockOrderController@rewardOrder');
    Route::get('/get_article',function(){return view('home.article.index');});
    Route::get('/flash/{maxId?}','ArticleController@redict');
    Route::post('/ajax_add','ArticleController@ajax_add');
//    Route::get('/index/{id}','ArticleController@flash');
});

Route::group(['namespace' => 'Home'], function () {
    Route::any('/wxpaynotify','MemberController@wxPayNotify');
    Route::any('/zfnotify','MemberController@zfnotify');
    Route::get('/stockrules/{id}','ActivityController@rules');
});



